"""
@Time: 2020/12/9 下午 8:08
@Author: jinzhuan
@File: fn_loader_test.py
@Desc: 
"""
import sys
sys.path.append('/data/zhuoran/code/cognlp')
from cognlp.io.loader.fn import FrameNetLoader
from cognlp.io.processor.fn import FrameNetProcessor
from cognlp.utils.util import save_json

loader = FrameNetLoader()
train_set, dev_set, test_set = loader.load("../data/fn/framenet/data")
# print(train_set)
# import pickle
#
# fr = open('../data/fn/framenet/data/lu_key_mapping.pkl', 'rb')  # open的参数是pkl文件的路径
# inf = pickle.load(fr)  # 读取pkl文件的内容
# fr.close()  # 关闭文件
#
# print(loader.get_labels())
# processor = FrameNetProcessor(label_list=loader.get_labels(), path="../data/fn/framenet/data")
# train_data = processor.process(train_set)
# dev_data = processor.process(dev_set)
# test_data = processor.process(test_set)
# save_json(train_data, '../data/fn/framenet/data/train.json')
# save_json(dev_data, '../data/fn/framenet/data/dev.json')
# save_json(test_data, '../data/fn/framenet/data/test.json')
import pickle

fr = open('../data/fn/framenet/data/lu_key_mapping.pkl', 'rb')  # open的参数是pkl文件的路径
inf = pickle.load(fr)  # 读取pkl文件的内容
fr.close()  # 关闭文件
print(1)
